package com.googlecode.imanager.client.exception;

import com.googlecode.imanager.client.Control;

/**
 * @author wellsantos@wellsantos.com
 * @since 0.01
 */
public class UIException extends IMException {

    private static final long serialVersionUID = 1L;

    private Control control;
    
    public UIException() {
        super();
    }

    public UIException(Control control) {
        this.control = control;
    }

    public UIException(String message) {
        super(message);
    }

    public UIException(Control control, String message) {
        super(message);
        this.control = control;
    }

    public UIException(String message, Throwable cause) {
        super(message, cause);
        if (cause instanceof UIException){
            control = ((UIException) cause).getControl();
        }
    }

    public UIException(Throwable cause) {
        super(cause);
        if (cause instanceof UIException){
            control = ((UIException) cause).getControl();
        }
    }

    public Control getControl() {
        return control;
    }
    
}
